package com.manager.devicemanager.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.manager.devicemanager.entity.Testcase;
import com.manager.devicemanager.mapper.TestcaseMapper;
import com.manager.devicemanager.service.ITestcaseService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import java.util.Collection;
import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author wpf
 * @since 2025-05-29
 */
@Service
public class TestcaseServiceImpl extends ServiceImpl<TestcaseMapper, Testcase> implements ITestcaseService {
    @Autowired
    private TestcaseMapper testcaseMapper;

    @Override
    public IPage<Testcase> Bypage(String dataSourceName, Page<Testcase> page, Testcase testcase) {
        return testcaseMapper.selectPage(page, new LambdaQueryWrapper<>(testcase));
    }

    @Override
    public Testcase getByDefault(String dataSourceName, LambdaQueryWrapper<Testcase> queryWrapper) {
        return testcaseMapper.selectOne(queryWrapper);
    }

    @Override
    public List<Testcase> getList(String dataSourceName) {
        return testcaseMapper.selectList(new LambdaQueryWrapper<Testcase>());
    }
}
